using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Graphe.WPF
{
    /// <summary>
    /// Interaction logic for CreateIndexItemWindow.xaml
    /// </summary>

    public partial class CreateIndexItemWindow : System.Windows.Window
    {
        #region Constructor

        public CreateIndexItemWindow()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(CreateIndexItemWindow_Loaded);
        }

        private void CreateIndexItemWindow_Loaded(object sender, RoutedEventArgs e)
        {
            _textBoxStartReference.Text = Reference.StartReference;
            _textBoxEndReference.Text = Reference.EndReference;
        }

        #endregion
        #region Private Instance Fields

        private ImageReference _reference;

        #endregion
        #region Public Properties

        public ImageReference Reference
        {
            get { return _reference; }
            set { _reference = value; }
        }

        #endregion

        private void _buttonSave_Click(object sender, RoutedEventArgs e)
        {
            Reference.StartReference = _textBoxStartReference.Text;
            Reference.EndReference = _textBoxEndReference.Text;

            this.DialogResult = true;
        }

        private void _buttonCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

    }
}